//
//  ALfindMasterViewController.m
//  TestAfn2
//
//  Created by XuJingJing on 16/7/23.
//  Copyright © 2016年 xujingjing. All rights reserved.
//

#import "ALfindMasterViewController.h"
#import "ALfindMasterView.h"
#import "ALFindMasterListCell.h"
#import "ALMoreMasterViewController.h"
#import "DRButton.h"
#import "OTCover.h"//头部拉伸

@interface ALfindMasterViewController ()<UITableViewDataSource,UITableViewDelegate,FindMasterHeaderDelegate>

@end

@implementation ALfindMasterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"拉伸header";
    OTCover *test = [[OTCover alloc] initWithTableViewWithHeaderImage:[UIImage imageNamed:@"image.png"] withOTCoverHeight:290];
    test.tableView.delegate = self;
    test.tableView.dataSource = self;
    [self.view addSubview:test];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
   
    static NSString *cell_id = @"FindMasterListcell";
    ALFindMasterListCell *cell = [tableView dequeueReusableCellWithIdentifier:cell_id];
    if (!cell) {
        cell = [[NSBundle mainBundle]loadNibNamed:@"ALFindMasterListCell" owner:self options:nil][0];
    }
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 68;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
   
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
}
//-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
//    ALfindMasterView *header = [[NSBundle mainBundle]loadNibNamed:@"ALfindMasterView" owner:self options:nil][0];
//    header.delegate = self;
//    return header;
//
//}
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
//   
//    return 272;
//    
//}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
-(void)pushDetailViewController:(DRButton *)button{
    [self.navigationController pushViewController:[[ALMoreMasterViewController alloc]init] animated:YES];

}
@end
